<?php include(TEMPLATE_DIR . 'header.tpl'); ?>
	<?php include(TEMPLATE_DIR . 'nav.tpl'); ?>
	<div class="main">
		<div class="push_stat_title">
			<h2>Push 发送记录查询</h2>
			<div class="line"></div>
		</div>
		<?php include($this->getVar('template_path') . 'search_box.tpl'); ?>
		<div class="push_stat_table_box">
			<table class="push_stat_table" border="0" width="100%">
				<tr align="center" valign="middle">
					<th>日期/时间</th>
					<th>产品名称</th>
					<th>Token</th>
					<th>标题</th>
					<th>接收时间</th>
					<th>发送时间</th>
					<th>花费时间</th>
					<th>发送结果</th>
					<th>主机</th>
					<th>操作</th>
				</tr>
				<?php if (!empty($output['data']['list'])): ?>
					<?php foreach($output['data']['list'] as $key => $row): ?>
						<tr>
							<td><?php echo $this->format($row['datetime'], 'HOUR_TEXT'); ?></td>
							<td><?php echo isset($output['prods'][$row['prod']]) ? $output['prods'][$row['prod']]['name'] : $this->format(null); ?></td>
							<td><?php echo $this->format($row['token']); ?></td>
							<td><?php echo $this->format($row['title']); ?></td>
							<td><?php echo $this->format($row['tmr'], 'STD_DATETIME'); ?></td>
							<td><?php echo $this->format(($this->getSendResult($row['tms']) !== 0 ? abs($row['tms']) : null), 'STD_DATETIME'); ?></td>
							<td>
								<?php if ($this->getSendResult($row['tms']) !== 0) : ?>
									<?php $spendTime = (abs($row['tms']) - $row['tmr']); ?>
									<span class="second" title="<?php echo $this->format($spendTime, 'STD_FLOAT_TIME_FULL'); ?>">
										<?php echo $this->format($spendTime, 'STD_FLOAT_TIME'); ?>
									</span>
								<?php else: ?>
									<?php echo $this->format(null); ?>
								<?php endif; ?>
							</td>
							<td><?php echo $this->getSendResult($row['tms'], true); ?></td>
							<td><?php echo $this->format(($this->getSendResult($row['tms']) !== 0 ? $row['hoststr'] : null), 'NULL_TEXT'); ?></td>
							<td><a href="#" onclick="pstat.show_detail('<?php echo $row['id']; ?>');">详细</a></td>
						</tr>
					<?php endforeach; ?>
					<tr>
						<td colspan="10">
							<?php include(TEMPLATE_DIR . '/pager.tpl'); ?>
						</td>
					</tr>
				<?php else: ?>
					<tr>
						<td colspan="10">
							
						</td>
					</tr>
				<?php endif; ?>
			</table>
			<div class="push_stat_tips">
				注:默认显示当天，全部产品的详细数据.
			</div>
		</div>
	</div>
<script type="text/javascript">
  $(function(){
	// 加载表单初始设置
	pstat.loadForm('stat_search_form');
  });
</script>
<?php include(TEMPLATE_DIR . '/footer.tpl'); ?>